package com.bkgy.modular.rollwlcc.service.impl;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.bkgy.modular.rollwlcc.dao.RollWlccDao;
import com.bkgy.modular.rollwlcc.entity.JRollWlcc;
import com.bkgy.modular.rollwlcc.entity.RollWlcc;
import com.bkgy.modular.rollwlcc.entity.RollWlcche;
import com.bkgy.modular.rollwlcc.entity.TEST1;
import com.bkgy.modular.rollwlcc.service.RollWlccService;
import com.bkgy.sys.common.entity.ResultData;
import com.bkgy.util.CodiUtil;
import com.bkgy.util.MathUtil;
import lombok.extern.apachecommons.CommonsLog;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

import java.util.ArrayList;
import java.util.List;


/**
 * 新全生命周期接口具体实现类
 *
 * @author 生成器生成
 * @date 2021-01-11 10:56:05
 */
@CommonsLog
@Service
//@Document
public class RollWlccServiceImpl implements RollWlccService {

    private final static Log logger = LogFactory.getLog(RollWlccServiceImpl.class);

    @Autowired
    private RollWlccDao rollWlccDao;

    //@Autowired
    //private RollInformationDao rollInformationDao;


    /**
     * 添加记录
     *
     * @param data   json字符串
     * @param userId 用户id
     * @param sname  用户姓名
     */
    public ResultData insertDataRollWlcc(String data, Long userId, String sname) {
        try {
            JRollWlcc jrollWlcc = JSON.parseObject(data, JRollWlcc.class);
            RollWlcc rollWlcc = jrollWlcc.getRollWlcc();
            CodiUtil.newRecord(userId, sname, rollWlcc);
            rollWlccDao.insertDataRollWlcc(rollWlcc);
            return ResultData.ResultDataSuccessSelf("添加数据成功", null);
        } catch (Exception e) {
            e.printStackTrace();
            return ResultData.ResultDataFaultSelf("添加失败，错误信息为" + e.getMessage(), null);
        }
    }

    /**
     * 根据主键删除对象
     *
     * @param indocno 对象主键
     */
    public ResultData deleteDataRollWlccOne(Long indocno) {
        try {
            rollWlccDao.deleteDataRollWlccOne(indocno);
            return ResultData.ResultDataSuccessSelf("删除数据成功", null);
        } catch (Exception e) {
            e.printStackTrace();
            return ResultData.ResultDataFaultSelf("删除失败,失败信息为" + e.getMessage(), null);
        }
    }

    /**
     * 根据主键字符串删除多个对象
     *
     * @param str_id 对象主键字符串
     */
    public ResultData deleteDataRollWlccMany(String str_id) {
        try {
            String sql = "delete roll_wlcc where indocno in(" + str_id + ")";
            rollWlccDao.deleteDataRollWlccMany(sql);
            return ResultData.ResultDataSuccessSelf("删除数据数据成功", null);
        } catch (Exception e) {
            e.printStackTrace();
            return ResultData.ResultDataFaultSelf("删除失败,失败信息为" + e.getMessage(), null);
        }
    }

    /**
     * 修改记录
     *
     * @param userId 用户id
     * @param sname  用户姓名
     * @param data   sysUser 对象实体
     */
    public ResultData updateDataRollWlcc(String data, Long userId, String sname) {
        try {
            JRollWlcc jrollWlcc = JSON.parseObject(data, JRollWlcc.class);
            RollWlcc rollWlcc = jrollWlcc.getRollWlcc();
            CodiUtil.editRecord(userId, sname, rollWlcc);
            rollWlccDao.updateDataRollWlcc(rollWlcc);
            return ResultData.ResultDataSuccessSelf("修改成功", null);
        } catch (Exception e) {
            e.printStackTrace();
            return ResultData.ResultDataFaultSelf("修改失败,失败信息为" + e.getMessage(), null);
        }
    }

    /**
     * 分页查看记录
     *
     * @param data 分页参数字符串
     */
    public ResultData findDataRollWlccByPage(String data) {
        try {
            JRollWlcc jrollWlcc = JSON.parseObject(data, JRollWlcc.class);
            JSONObject jsonObject = null;
            Integer pageIndex = jrollWlcc.getPageIndex();
            Integer pageSize = jrollWlcc.getPageSize();

            if (null == pageIndex || null == pageSize) {
                return ResultData.ResultDataFaultSelf("分页参数没有传", null);
            }

            if (null != jrollWlcc.getCondition()) {
                jsonObject = JSON.parseObject(jrollWlcc.getCondition().toString());
            }

            String roll_no = null;
            if (!StringUtils.isEmpty(jsonObject.get("roll_no"))) {
                roll_no = jsonObject.get("roll_no").toString();
            }

            String roll_typeid = null;
            if (!StringUtils.isEmpty(jsonObject.get("roll_typeid"))) {
                roll_typeid = jsonObject.get("roll_typeid").toString();
            }

            String dbegino = null;
            String dendo = null;
            String dbeging = null;
            String dendg = null;
            Long oc = null;
            if (!StringUtils.isEmpty(jsonObject.get("dbegino"))) {
                dbegino = jsonObject.get("dbegino").toString();
            }
            if (!StringUtils.isEmpty(jsonObject.get("dendo"))) {
                dendo = jsonObject.get("dendo").toString();
            }
            if (!StringUtils.isEmpty(jsonObject.get("dbeging"))) {
                dbeging = jsonObject.get("dbeging").toString();
            }
            if (!StringUtils.isEmpty(jsonObject.get("dendg"))) {
                dendg = jsonObject.get("dendg").toString();
            }
            if (!StringUtils.isEmpty(jsonObject.get("oc"))) {
                oc = Long.parseLong(jsonObject.get("oc").toString());
            }

           // List<TEST1> list = rollWlccDao.findDataRollWlccByPage();
            List<TEST1> list = rollWlccDao.findDataRollWlccByPage((pageIndex - 1) * pageSize, pageIndex* pageSize);
            Integer count = rollWlccDao.findDataRollWlccByPageSize();

            //分页测试
            //0-10     大于0小于等于10
            //10-20   大于10小于等于20
            //List<RollWlcc> list = rollWlccDao.findDataRollWlccByPage((pageIndex - 1) * pageSize, pageSize, roll_no, roll_typeid, dbegino, dendo, dbeging, dendg, oc);
            //Integer count = rollWlccDao.findDataRollWlccByPageSize(roll_no, roll_typeid, dbegino, dendo, dbeging, dendg, oc);
            return ResultData.ResultDataSuccess(list, count);
        } catch (Exception e) {
            e.printStackTrace();
            return ResultData.ResultDataFaultSelf("查询失败,失败信息为" + e.getMessage(), null);
        }
    }

    /**
     * 根据主键查询单条记录
     *
     * @param data 分页参数字符串
     */
    public ResultData findDataRollWlccByIndocno(String data) {
        try {
            JRollWlcc jrollWlcc = JSON.parseObject(data, JRollWlcc.class);
            Long indocno = jrollWlcc.getIndocno();

            RollWlcc rollWlcc = rollWlccDao.findDataRollWlccByIndocno(indocno);
            return ResultData.ResultDataSuccess(rollWlcc);
        } catch (Exception e) {
            e.printStackTrace();
            return ResultData.ResultDataFaultSelf("查询失败,失败信息为" + e.getMessage(), null);
        }
    }

    /**
     * 查看记录
     *
     * @return list 对象集合返回
     */
    public List<RollWlcc> findDataRollWlcc() {
        List<RollWlcc> list = rollWlccDao.findDataRollWlcc();
        return list;
    }

    /*@Override
    public List<RollWlccNew> wlcc_new(String roll_no) {
        List<RollWlccNew> list = new ArrayList<RollWlccNew>();
        RollInformation r = rollInformationDao.findDataRollInformationByRollNo(roll_no);
        List<RollWlcc> list_entity = rollWlccDao.findDataRollWlccAllByReason(roll_no, null, null);
        if (list_entity != null && list_entity.size() > 0) {
            for (RollWlcc entity : list_entity) {
                RollWlccNew roll_wlcc = new RollWlccNew();
                roll_wlcc.setRolltonnage(entity.getRollkilometer());
                roll_wlcc.setBefore_diameter(entity.getBefore_diameter());
                roll_wlcc.setAfter_diameter(entity.getAfter_diameter());
                if (r != null) {
                    if (!StringUtils.isEmpty(r.getRolltonnagemm())) {
                        roll_wlcc.setRolltonnagemm(r.getRolltonnagemm());
                    }
                }
                list.add(roll_wlcc);
            }
            return list;
        } else {
            return list;
        }
    }*/

    /**
     * 事故辊管理页面专用——根据封锁时间和辊号，查询磨削量不为0的正序三次下机时间不重复数据，重复的依旧显示
     */
    @Override
    public ResultData findWlccA(String data) {
        try {
            List<RollWlcc> list = new ArrayList<>();
            RollWlcc rollWlcc = JSON.parseObject(data, RollWlcc.class);
            String roll_no = rollWlcc.getRoll_no();
            String offlinetime = rollWlcc.getOfflinetime();
            String times = rollWlccDao.findtimes(roll_no, offlinetime);
            if (!StringUtils.isEmpty(times)) {
                list = rollWlccDao.findOffline(roll_no, offlinetime, times);
                return ResultData.ResultDataSuccess(list);
            } else {
                return ResultData.ResultDataSuccess(null);
            }

        } catch (Exception e) {
            e.printStackTrace();
            return ResultData.ResultDataFaultSelf("查询失败,失败信息为" + e.getMessage(), null);
        }
    }

    @Override
    public ResultData findchartsnosum(String data) {
        try {
            JRollWlcc jrollWlcc = JSON.parseObject(data, JRollWlcc.class);
            JSONObject jsonObject = null;

            if (null != jrollWlcc.getCondition()) {
                jsonObject = JSON.parseObject(jrollWlcc.getCondition().toString());
            }

            String dbeging = null;
            String dendg = null;
            if (!StringUtils.isEmpty(jsonObject.get("dbeging"))) {
                dbeging = jsonObject.get("dbeging").toString();
            }
            if (!StringUtils.isEmpty(jsonObject.get("dendg"))) {
                dendg = jsonObject.get("dendg").toString();
            }
            //正常辊
            List<RollWlcche> list = rollWlccDao.findDataRollWlcccharts(dbeging, dendg);

            for (RollWlcche entity : list) {
                String machine_no = entity.getMachine_no();
                String sgroup = entity.getSgroup();
                //事故辊
                RollWlcche roll_accident = rollWlccDao.findDataRollaccident(machine_no, sgroup, dbeging, dendg);

                if (!StringUtils.isEmpty(roll_accident)) {
                    entity.setCountass(entity.getCountass() + roll_accident.getCountass());
                    entity.setSum_value(entity.getSum_value() + roll_accident.getSum_value());
                }
            }

            return ResultData.ResultDataSuccess(list);
        } catch (Exception e) {
            e.printStackTrace();
            return ResultData.ResultDataFaultSelf("查询失败,失败信息为" + e.getMessage(), null);
        }
    }

    @Override
    public ResultData findchartsdo(String data) {
        try {
            JRollWlcc jrollWlcc = JSON.parseObject(data, JRollWlcc.class);
            JSONObject jsonObject = null;
            if (null != jrollWlcc.getCondition()) {
                jsonObject = JSON.parseObject(jrollWlcc.getCondition().toString());
            }

            String dbeging = null;
            String dendg = null;
            if (!StringUtils.isEmpty(jsonObject.get("dbeging"))) {
                dbeging = jsonObject.get("dbeging").toString();
            }
            if (!StringUtils.isEmpty(jsonObject.get("dendg"))) {
                dendg = jsonObject.get("dendg").toString();
            }

            List<RollWlcche> list = new ArrayList<>();
            for (int i = 3; 7 > i; i++) {
                String machine_no = String.valueOf(i);
                List<RollWlcche> list_a = rollWlccDao.findDataRollchao(machine_no, dbeging, dendg);
                list.addAll(list_a);
            }
            return ResultData.ResultDataSuccess(list);
        } catch (Exception e) {
            e.printStackTrace();
            return ResultData.ResultDataFaultSelf("查询失败,失败信息为" + e.getMessage(), null);
        }
    }

    @Override
    public ResultData findchartsnosum_b(String data) {
        try {
            JRollWlcc jrollWlcc = JSON.parseObject(data, JRollWlcc.class);
            JSONObject jsonObject = null;
            if (null != jrollWlcc.getCondition()) {
                jsonObject = JSON.parseObject(jrollWlcc.getCondition().toString());
            }

            String dbeging = null;
            String dendg = null;
            if (!StringUtils.isEmpty(jsonObject.get("dbeging"))) {
                dbeging = jsonObject.get("dbeging").toString();
            }
            if (!StringUtils.isEmpty(jsonObject.get("dendg"))) {
                dendg = jsonObject.get("dendg").toString();
            }
            //正常棍
            List<RollWlcche> list = rollWlccDao.findDataRollWlcccharts_b(dbeging, dendg);

            for (RollWlcche entity : list) {
                entity.setSgroup("万能");
                String machine_no = entity.getMachine_no();
                String sgroup = null;
                //事故棍
                RollWlcche roll_accident = rollWlccDao.findDataRollaccident(machine_no, sgroup, dbeging, dendg);

                if (!StringUtils.isEmpty(roll_accident)) {
                    entity.setCountass(entity.getCountass() + roll_accident.getCountass());
                    entity.setSum_value(entity.getSum_value() + roll_accident.getSum_value());
                }
            }

            return ResultData.ResultDataSuccess(list);
        } catch (Exception e) {
            e.printStackTrace();
            return ResultData.ResultDataFaultSelf("查询失败,失败信息为" + e.getMessage(), null);
        }
    }

    //1，2磨床探伤
    @Override
    public ResultData findchartsdo_b(String data) {
        try {
            JRollWlcc jrollWlcc = JSON.parseObject(data, JRollWlcc.class);
            JSONObject jsonObject = null;
            if (null != jrollWlcc.getCondition()) {
                jsonObject = JSON.parseObject(jrollWlcc.getCondition().toString());
            }

            String dbeging = null;
            String dendg = null;
            if (!StringUtils.isEmpty(jsonObject.get("dbeging"))) {
                dbeging = jsonObject.get("dbeging").toString();
            }
            if (!StringUtils.isEmpty(jsonObject.get("dendg"))) {
                dendg = jsonObject.get("dendg").toString();
            }

            List<RollWlcche> list = new ArrayList<>();
            for (int i = 1; 3 > i; i++) {
                String machine_no = toString().valueOf(i);
                List<RollWlcche> list_a = rollWlccDao.findDataRollchao_a(machine_no, dbeging, dendg);

                if (list_a != null && list_a.size() != 0 && list_a.get(0) != null) {
                    for (RollWlcche entity : list_a) {
                        entity.setSgroup("万能");
                        list.add(entity);
                    }
                }
            }
            return ResultData.ResultDataSuccess(list);
        } catch (Exception e) {
            e.printStackTrace();
            return ResultData.ResultDataFaultSelf("查询失败,失败信息为" + e.getMessage(), null);
        }
    }

    @Override
    public ResultData findmotable(String data) {
        try {
            JRollWlcc jrollWlcc = JSON.parseObject(data, JRollWlcc.class);
            JSONObject jsonObject = null;
            if (null != jrollWlcc.getCondition()) {
                jsonObject = JSON.parseObject(jrollWlcc.getCondition().toString());
            }

            String dbeging = null;
            String dendg = null;
            if (!StringUtils.isEmpty(jsonObject.get("dbeging"))) {
                dbeging = jsonObject.get("dbeging").toString();
            }
            if (!StringUtils.isEmpty(jsonObject.get("dendg"))) {
                dendg = jsonObject.get("dendg").toString();
            }

            List<RollWlcche> list = new ArrayList<>();
            for (int i = 3; 7 > i; i++) {
                String machine_no = toString().valueOf(i);
                List<RollWlcche> listm = new ArrayList<>();
                List<RollWlcche> list1 = find_meath(machine_no, "甲", dbeging, dendg);
                List<RollWlcche> list2 = find_meath(machine_no, "乙", dbeging, dendg);
                List<RollWlcche> list3 = find_meath(machine_no, "丙", dbeging, dendg);
                List<RollWlcche> list4 = find_meath(machine_no, "丁", dbeging, dendg);
                list.add(list1.get(0));
                list.add(list2.get(0));
                list.add(list3.get(0));
                list.add(list4.get(0));
            }

            for (int n = 1; 3 > n; n++) {
                String machine_no = toString().valueOf(n);
                List<RollWlcche> listm = new ArrayList<>();
                List<RollWlcche> list1 = find_meath_12(machine_no, dbeging, dendg);
                list.add(list1.get(0));
            }
            return ResultData.ResultDataSuccess(list);
        } catch (Exception e) {
            e.printStackTrace();
            return ResultData.ResultDataFaultSelf("查询失败,失败信息为" + e.getMessage(), null);
        }
    }

    /*@Override
    public void insertMath(RollGrindingBF bean) {
        List<RollWlcc> lcc = rollWlccDao.findDataRollWlccByTime(bean.getRoll_no(), bean.getGrind_starttime());
        if (lcc != null && lcc.size() > 0) {
            RollWlcc c = lcc.get(0);
            if (StringUtils.isEmpty(c.getBefore_diameter())) {  //如果为空，表示该记录需要往里面更新后面的磨削数据
                BeanUtils.copyProperties(bean,c);
                c.setGrind_starttime(bean.getGrind_starttime());
                if (!StringUtils.isEmpty(bean.getGrind_endtime())) {
                    c.setGrind_endtime(bean.getGrind_endtime());
                }
                if (!StringUtils.isEmpty(bean.getMachineno())) {
                    c.setMachine_no(bean.getMachineno());
                }
                if (!StringUtils.isEmpty(bean.getBefore_diameter())) {
                    c.setBefore_diameter(bean.getBefore_diameter());
                }
                if (!StringUtils.isEmpty(bean.getAfter_diameter())) {
                    c.setAfter_diameter(bean.getAfter_diameter());
                }
                if (!StringUtils.isEmpty(bean.getTaper())) {
                    c.setTaper(bean.getTaper());
                }
                if (!StringUtils.isEmpty(bean.getRoundness())) {
                    c.setRoundness(bean.getRoundness());
                }
                if (!StringUtils.isEmpty(bean.getWheel_dia_start())) {
                    c.setWheel_dia_start(bean.getWheel_dia_start());
                }
                if (!StringUtils.isEmpty(bean.getWheel_dia_end())) {
                    c.setWheel_dia_end(bean.getWheel_dia_end());
                }
                if (!StringUtils.isEmpty(bean.getQualifiednum())) {
                    c.setQualifiednum(bean.getQualifiednum());
                }
                if (!StringUtils.isEmpty(bean.getSgroup())) {
                    c.setSbz(bean.getSgroup());
                }
                if (!StringUtils.isEmpty(bean.getBefore_diameter()) && !StringUtils.isEmpty(bean.getAfter_diameter())) {
                    c.setFirst_wear(bean.getBefore_diameter() - bean.getAfter_diameter());
                    c.setSecond_wear(0d);
                }
                rollWlccDao.updateDataRollWlcc(c);
            } else {  //如果不为空，表示当前磨削记录是二次磨削或者三次磨削,需要插入数据，同时获取这次的上下线实绩数据一起插入
                //多次磨削
                List<RollWlcc> hav = rollWlccDao.findDataHave(bean.getRoll_no(), bean.getGrind_starttime(), bean.getGrind_endtime());
                if (hav.size() == 0) {
                    RollWlcc c_new = new RollWlcc();
                    BeanUtils.copyProperties(c, c_new);  //把entity属性赋值给后面对象
                   // c_new.setIndocno(null);
                    c_new.setIstate(1L);  //多次磨削标识
                    //然后把该磨削记录录入进去
                   // c_new.setGrind_starttime(bean.getGrind_starttime());
                    if (!StringUtils.isEmpty(bean.getGrind_endtime())) {
                        c_new.setGrind_endtime(bean.getGrind_endtime());
                    }
                    if (!StringUtils.isEmpty(bean.getMachineno())) {
                        c_new.setMachine_no(bean.getMachineno());
                    }
                    if (!StringUtils.isEmpty(bean.getBefore_diameter())) {
                        c_new.setBefore_diameter(bean.getBefore_diameter());
                    }
                    if (!StringUtils.isEmpty(bean.getAfter_diameter())) {
                        c_new.setAfter_diameter(bean.getAfter_diameter());
                    }
                    if (!StringUtils.isEmpty(bean.getTaper())) {
                        c_new.setTaper(bean.getTaper());
                    }
                    if (!StringUtils.isEmpty(bean.getRoundness())) {
                        c_new.setRoundness(bean.getRoundness());
                    }
                    if (!StringUtils.isEmpty(bean.getWheel_dia_start())) {
                        c_new.setWheel_dia_start(bean.getWheel_dia_start());
                    }
                    if (!StringUtils.isEmpty(bean.getWheel_dia_end())) {
                        c_new.setWheel_dia_end(bean.getWheel_dia_end());
                    }
                    if (!StringUtils.isEmpty(bean.getQualifiednum())) {
                        c_new.setQualifiednum(bean.getQualifiednum());
                    }
                    if (!StringUtils.isEmpty(bean.getSgroup())) {
                        c_new.setSbz(bean.getSgroup());
                    }
                    //c_new.setFirst_wear(c.getFirst_wear());
                    if (!StringUtils.isEmpty(bean.getBefore_diameter()) && !StringUtils.isEmpty(bean.getAfter_diameter())) {
                        c_new.setSecond_wear((bean.getBefore_diameter() - bean.getAfter_diameter()) + c.getSecond_wear());
                    }
                    rollWlccDao.updateDataRollWlcc(c_new);
                    *//*List<RollWlcc> l = rollWlccDao.findDataHave(c_new.getRoll_no(), c_new.getGrind_starttime(), c_new.getGrind_endtime());
                    if (l.size() == 0) {
                        //rollWlccDao.insertDataRollWlcc(c_new);
                        rollWlccDao.updateDataRollWlcc(c_new);
                    }*//*
                }
            }
        } else {
            RollWlcc c_toe = new RollWlcc();
            BeanUtils.copyProperties(bean, c_toe);  //把entity属性赋值给后面对象
            c_toe.setIndocno(null);
            logger.debug("wlcc表轧辊号" + bean.getRoll_no()+"磨削开时间:"+bean.getGrind_starttime());
            rollWlccDao.insertDataRollWlcc(c_toe);
        }
    }*/

    private List<RollWlcche> find_meath(String machine_no, String sgroup, String dbeging, String dendg) {
        //3-6正常辊 磨削之数和磨削总量 和正常辊的平均磨削量
        List<RollWlcche> list_a = rollWlccDao.find3_4nomal(machine_no, sgroup, dbeging, dendg);
        list_a.get(0).setMachine_no(machine_no);
        list_a.get(0).setSgroup(sgroup);
        if (list_a.get(0).getSum_value() == null) {
            list_a.get(0).setSum_value(0.0);
        }
        // 3-6事故辊
        RollWlcche roll_accident = rollWlccDao.findDataRollaccident(machine_no, sgroup, dbeging, dendg);

        if (!StringUtils.isEmpty(roll_accident)) {
            list_a.get(0).setCountass(list_a.get(0).getCountass() + roll_accident.getCountass());
            list_a.get(0).setSum_value(MathUtil.tofixed((list_a.get(0).getSum_value() + roll_accident.getSum_value()), 2));
        }
        //探伤 俩值
        RollWlcche list_c = rollWlccDao.findDataRollchao_table(machine_no, sgroup, dbeging, dendg);

        if (!StringUtils.isEmpty(list_c)) {
            list_a.get(0).setRoundness_act(list_c.getRoundness_act());
            list_a.get(0).setShang_act(list_c.getShang_act());
        }
        return list_a;
    }

    private List<RollWlcche> find_meath_12(String machine_no, String dbeging, String dendg) {
        //1-2正常辊 磨削之数和磨削总量 和正常辊的平均磨削量
        String sgroup = null;
        List<RollWlcche> list_a = rollWlccDao.find1_2nomal(machine_no, sgroup, dbeging, dendg);

        list_a.get(0).setMachine_no(machine_no);
        list_a.get(0).setSgroup("万能");

        if (list_a.get(0).getSum_value() == null) {
            list_a.get(0).setSum_value(0.0);
        }
        // 1-2事故辊
        RollWlcche roll_accident = rollWlccDao.findDataRollaccident(machine_no, sgroup, dbeging, dendg);

        if (!StringUtils.isEmpty(roll_accident)) {
            list_a.get(0).setCountass(list_a.get(0).getCountass() + roll_accident.getCountass());
            list_a.get(0).setSum_value(MathUtil.tofixed((list_a.get(0).getSum_value() + roll_accident.getSum_value()), 2));
        }
        //探伤 俩值
        List<RollWlcche> list_c = rollWlccDao.findDataRollchao_a(machine_no, dbeging, dendg);

        if (list_c != null && list_c.size() != 0 && list_c.get(0) != null) {
            list_a.get(0).setRoundness_act(list_c.get(0).getRoundness_act());
            list_a.get(0).setShang_act(list_c.get(0).getShang_act());
        }
        return list_a;
    }
}
